package com.yichuang.wuziqi.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.yichuang.wuziqi.R;
import com.yichuang.wuziqi.tool.IntentTools;

/**
 * Created by xcm on 18-1-12.
 */

public class Menu extends AppCompatActivity implements View.OnClickListener{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);
        initView();
    }

    private void initView() {
        Button localGameBtn = findViewById(R.id.local_game);
        Button networkGameBtn = findViewById(R.id.network_game);
        Button trainingBtn = findViewById(R.id.collection);

        localGameBtn.setOnClickListener(this);
        networkGameBtn.setOnClickListener(this);
        trainingBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.local_game:
                IntentTools.startActivity(this, LocalGameActivity.class);
                break;
            case R.id.network_game:
                IntentTools.startActivity(this, NetworkGameActivity.class);
                break;
            case R.id.collection:
                IntentTools.startActivity(this, CollectionActivity.class);
                break;
        }
    }
}
